<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>java学习 | Xpand Bolg</title><meta name="keywords" content="java"><meta name="author" content="Xpand"><meta name="copyright" content="Xpand"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><meta name="description" content="Java笔记Java快速入门1.1第一个java程序12345public class test1&amp;#123;    public static void main(String[] args) &amp;#123;        System.out.println(&quot;第一个java程序&quot;);    &amp;#125;&amp;#125;  继承Student是Person子类  向上转型  12">
<meta property="og:type" content="article">
<meta property="og:title" content="java学习">
<meta property="og:url" content="https://www.qwas.top/p/java.html/index.html">
<meta property="og:site_name" content="Xpand Bolg">
<meta property="og:description" content="Java笔记Java快速入门1.1第一个java程序12345public class test1&amp;#123;    public static void main(String[] args) &amp;#123;        System.out.println(&quot;第一个java程序&quot;);    &amp;#125;&amp;#125;  继承Student是Person子类  向上转型  12">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn/img/202204211026385.png">
<meta property="article:published_time" content="2020-11-01T03:11:11.000Z">
<meta property="article:modified_time" content="2022-06-02T02:49:46.461Z">
<meta property="article:author" content="Xpand">
<meta property="article:tag" content="java">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn/img/202204211026385.png"><link rel="shortcut icon" href="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn/img/202204211011022.png"><link rel="canonical" href="https://www.qwas.top/p/java.html/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="preconnect" href="//zz.bdstatic.com"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script>var GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: {"limitDay":180,"position":"top","messagePrev":"自上次文章更新已有","messageNext":"天，文章的内容可能已经过时"},
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":249,"languages":{"author":"作者: Xpand","link":"链接: ","source":"来源: Xpand Bolg","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"bottom-center"},
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: true,
  isanchor: true
};

var saveToLocal = {
  set: function setWithExpiry(key, value, ttl) {
    const now = new Date()
    const expiryDay = ttl * 86400000
    const item = {
      value: value,
      expiry: now.getTime() + expiryDay,
    }
    localStorage.setItem(key, JSON.stringify(item))
  },

  get: function getWithExpiry(key) {
    const itemStr = localStorage.getItem(key)

    if (!itemStr) {
      return undefined
    }
    const item = JSON.parse(itemStr)
    const now = new Date()

    if (now.getTime() > item.expiry) {
      localStorage.removeItem(key)
      return undefined
    }
    return item.value
  }
}

// https://stackoverflow.com/questions/16839698/jquery-getscript-alternative-in-native-javascript
const getScript = url => new Promise((resolve, reject) => {
  const script = document.createElement('script')
  script.src = url
  script.async = true
  script.onerror = reject
  script.onload = script.onreadystatechange = function() {
    const loadState = this.readyState
    if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
    script.onload = script.onreadystatechange = null
    resolve()
  }
  document.head.appendChild(script)
})</script><script id="config_change">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-06-02 10:49:46'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(function () {  window.activateDarkMode = function () {
    document.documentElement.setAttribute('data-theme', 'dark')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
    }
  }
  window.activateLightMode = function () {
    document.documentElement.setAttribute('data-theme', 'light')
   if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
    }
  }
  const autoChangeMode = '1'
  const t = saveToLocal.get('theme')
  if (autoChangeMode === '1') {
    const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
    const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
    const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
    const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
    if (t === undefined) {
      if (isLightMode) activateLightMode()
      else if (isDarkMode) activateDarkMode()
      else if (isNotSpecified || hasNoSupport) {
        const now = new Date()
        const hour = now.getHours()
        const isNight = hour <= 6 || hour >= 18
        isNight ? activateDarkMode() : activateLightMode()
      }
      window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
        if (saveToLocal.get('theme') === undefined) {
          e.matches ? activateDarkMode() : activateLightMode()
        }
      })
    } else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else if (autoChangeMode === '2') {
    const now = new Date()
    const hour = now.getHours()
    const isNight = hour <= 6 || hour >= 18
    if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
    else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else {
    if (t === 'dark') activateDarkMode()
    else if (t === 'light') activateLightMode()
  }const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
   if (asideStatus === 'hide') {
     document.documentElement.classList.add('hide-aside')
   } else {
     document.documentElement.classList.remove('hide-aside')
   }
}const fontSizeVal = saveToLocal.get('global-font-size')
if (fontSizeVal !== undefined) {
  document.documentElement.style.setProperty('--global-font-size', fontSizeVal + 'px')
}})()</script><link rel="stylesheet" href="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@latest/clock/css/clock.css"/><link rel="stylesheet" href="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@latest/bgcss.css"><link rel="stylesheet" href="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@latest/xpand_fish.css"><meta name="generator" content="Hexo 5.2.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" data-lazy-src="https://q.qlogo.cn/headimg_dl?dst_uin=1822705653&amp;spec=640&amp;img_type=jpg" onerror="onerror=null;src='https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@master/404/404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">11</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">17</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></div><div class="menus_item"><a class="site-page" href="/comments/"><i class="fa-fw fas fa-comment-dots"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/bgset/"><i class="fa-fw fas fa-toggle-on"></i><span> 背景切换</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fab fa-google-drive"></i><span> 网盘</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" target="_blank" rel="noopener" href="https://pan.qwas.top/"><i class="fa-fw fab fa-google-drive"></i><span> google网盘</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://one.qwas.top/"><i class="fa-fw fa-solid fa-hard-drive"></i><span> 微软网盘</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://xppan.herokuapp.com/"><i class="fa-fw fa-solid fa-upload"></i><span> 合集网盘</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa-solid fa-toolbox"></i><span> 杂乱</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" target="_blank" rel="noopener" href="http://chi.qwas.top/"><i class="fa-fw fas fa-utensils"></i><span> 吃什么</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://xiaoxigua.vercel.app/"><i class="fa-fw fas fa-life-ring"></i><span> 合成大西瓜</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://links.qwas.top/"><i class="fa-fw fa-solid fa-paperclip"></i><span> 短链生成</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="http://d.qwas.top/"><i class="fa-fw fas fa-map"></i><span> 导航</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://github.xpand.workers.dev/"><i class="fa-fw fab fa-git"></i><span> GitHub镜像站</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://github0.xpand.workers.dev/"><i class="fa-fw fa-brands fa-github-alt"></i><span> GitHub加速站</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://so.xpand.workers.dev/"><i class="fa-fw fa-brands fa-soundcloud"></i><span> 代理网页</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://xpand.gitee.io/"><i class="fa-fw fab fa-git"></i><span> 博客镜像站</span></a></li></ul></div></div></div></div><div id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url(https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn/img/202204211026385.png)"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Xpand Bolg</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></div><div class="menus_item"><a class="site-page" href="/comments/"><i class="fa-fw fas fa-comment-dots"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/bgset/"><i class="fa-fw fas fa-toggle-on"></i><span> 背景切换</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fab fa-google-drive"></i><span> 网盘</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" target="_blank" rel="noopener" href="https://pan.qwas.top/"><i class="fa-fw fab fa-google-drive"></i><span> google网盘</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://one.qwas.top/"><i class="fa-fw fa-solid fa-hard-drive"></i><span> 微软网盘</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://xppan.herokuapp.com/"><i class="fa-fw fa-solid fa-upload"></i><span> 合集网盘</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fa-solid fa-toolbox"></i><span> 杂乱</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" target="_blank" rel="noopener" href="http://chi.qwas.top/"><i class="fa-fw fas fa-utensils"></i><span> 吃什么</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://xiaoxigua.vercel.app/"><i class="fa-fw fas fa-life-ring"></i><span> 合成大西瓜</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://links.qwas.top/"><i class="fa-fw fa-solid fa-paperclip"></i><span> 短链生成</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="http://d.qwas.top/"><i class="fa-fw fas fa-map"></i><span> 导航</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://github.xpand.workers.dev/"><i class="fa-fw fab fa-git"></i><span> GitHub镜像站</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://github0.xpand.workers.dev/"><i class="fa-fw fa-brands fa-github-alt"></i><span> GitHub加速站</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://so.xpand.workers.dev/"><i class="fa-fw fa-brands fa-soundcloud"></i><span> 代理网页</span></a></li><li><a class="site-page" target="_blank" rel="noopener" href="https://xpand.gitee.io/"><i class="fa-fw fab fa-git"></i><span> 博客镜像站</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">java学习</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-11-01T03:11:11.000Z" title="发表于 2020-11-01 11:11:11">2020-11-01</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-06-02T02:49:46.461Z" title="更新于 2022-06-02 10:49:46">2022-06-02</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E5%AD%A6%E4%B9%A0/">学习</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">5.5k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>19分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/hint.css/2.4.1/hint.min.css"><h1 id="Java笔记"><a href="#Java笔记" class="headerlink" title="Java笔记"></a>Java笔记</h1><h2 id="Java快速入门"><a href="#Java快速入门" class="headerlink" title="Java快速入门"></a>Java快速入门</h2><h3 id="1-1第一个java程序"><a href="#1-1第一个java程序" class="headerlink" title="1.1第一个java程序"></a>1.1第一个java程序</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">test1</span></span>&#123;</span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">        System.out.println(<span class="string">&quot;第一个java程序&quot;</span>);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="继承"><a href="#继承" class="headerlink" title="继承"></a>继承</h2><p>Student是Person子类</p>
<blockquote>
<p>向上转型</p>
</blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">Student s = <span class="keyword">new</span> Student();</span><br><span class="line">Person p  = <span class="keyword">new</span> Person();</span><br><span class="line">Person p = <span class="keyword">new</span> Student();</span><br><span class="line"><span class="comment">//允许</span></span><br></pre></td></tr></table></figure>

<blockquote>
<p>向下转型</p>
</blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">Person p1 = <span class="keyword">new</span> Student(); <span class="comment">// upcasting, ok</span></span><br><span class="line">Person p2 = <span class="keyword">new</span> Person();</span><br><span class="line">Student s1 = (Student) p1; <span class="comment">// ok</span></span><br><span class="line">Student s2 = (Student) p2; <span class="comment">// runtime error! ClassCastException!</span></span><br><span class="line"><span class="comment">//不能把父类转换成子类,因为子类的功能比父类多</span></span><br></pre></td></tr></table></figure>

<p>instanceof,在向下转移前可以先判断</p>
<h2 id="多态"><a href="#多态" class="headerlink" title="多态"></a>多态</h2><p> <code>Override</code>是覆写(重写)<code>Overload</code>是新方法</p>
<h2 id="接口"><a href="#接口" class="headerlink" title="接口"></a>接口</h2><p>定义一个接口用<code>interface</code></p>
<p>实现一个接口用<code>implements </code></p>
<h1 id="java核心类"><a href="#java核心类" class="headerlink" title="java核心类"></a>java核心类</h1><p>1.1 字符串和编码</p>
<p>比较字符串用<code>equals()</code>,要忽略大小写比较，使用<code>equalsIgnoreCase()</code>方法</p>
<p>学习地址:<a target="_blank" rel="noopener" href="https://www.liaoxuefeng.com/wiki/1252599548343744/1260469698963456">https://www.liaoxuefeng.com/wiki/1252599548343744/1260469698963456</a></p>
<p>1.2 StringBuilder</p>
<p><code>StringBuffer</code>，这是Java早期的一个<code>StringBuilder</code>的线程安全版本，它通过同步来保证多个线程操作<code>StringBuffer</code>也是安全的，但是同步会带来执行速度的下降。</p>
<p><code>StringBuilder</code>和<code>StringBuffer</code>接口完全相同，现在完全没有必要使用<code>StringBuffer</code>。</p>
<p>1.3 包装类型</p>
<ul>
<li><p>基本类型：<code>byte</code>，<code>short</code>，<code>int</code>，<code>long</code>，<code>boolean</code>，<code>float</code>，<code>double</code>，<code>char</code></p>
</li>
<li><p>引用类型：所有<code>class</code>和<code>interface</code>类型</p>
</li>
<li><table>
<thead>
<tr>
<th align="left">基本类型</th>
<th align="left">对应的引用类型</th>
</tr>
</thead>
<tbody><tr>
<td align="left">boolean</td>
<td align="left">java.lang.Boolean</td>
</tr>
<tr>
<td align="left">byte</td>
<td align="left">java.lang.Byte</td>
</tr>
<tr>
<td align="left">short</td>
<td align="left">java.lang.Short</td>
</tr>
<tr>
<td align="left">int</td>
<td align="left">java.lang.Integer</td>
</tr>
<tr>
<td align="left">long</td>
<td align="left">java.lang.Long</td>
</tr>
<tr>
<td align="left">float</td>
<td align="left">java.lang.Float</td>
</tr>
<tr>
<td align="left">double</td>
<td align="left">java.lang.Double</td>
</tr>
<tr>
<td align="left">char</td>
<td align="left">java.lang.Character</td>
</tr>
</tbody></table>
</li>
</ul>
<p>1.X BigInteger</p>
<p><code>java.math.BigInteger</code>用来表示任意大小的整数。<code>BigInteger</code>内部用一个<code>int[]</code>数组来模拟一个非常大的整数；</p>
<p>和<code>long</code>型整数运算比，<code>BigInteger</code>不会有范围限制，但缺点是速度比较慢；</p>
<p><code>BigInteger</code>和<code>Integer</code>、<code>Long</code>一样，也是不可变类，并且也继承自<code>Number</code>类；</p>
<p>使用<code>longValueExact()</code>方法时，如果超出了<code>long</code>型的范围，会抛出<code>ArithmeticException</code>；</p>
<p>如果<code>BigInteger</code>的值超过了<code>float</code>的最大范围，返回 Infinity 。</p>
<p>1.X BigDecimal</p>
<p><code>BigDecimal</code>用于表示精确的小数，常用于财务计算；</p>
<p>比较<code>BigDecimal</code>的值是否相等，必须使用<code>compareTo()</code>而不能使用<code>equals()</code>。</p>
<p>1.x Java提供的常用工具类有：</p>
<ul>
<li>Math：数学计算</li>
<li>Random：生成伪随机数</li>
<li>SecureRandom：生成安全的随机数</li>
</ul>
<h1 id="异常处理"><a href="#异常处理" class="headerlink" title="异常处理"></a>异常处理</h1><p>因为Java的异常是<code>class</code>，它的继承关系如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line">                     ┌───────────┐</span><br><span class="line">                     │  Object   │</span><br><span class="line">                     └───────────┘</span><br><span class="line">                           ▲</span><br><span class="line">                           │</span><br><span class="line">                     ┌───────────┐</span><br><span class="line">                     │ Throwable │</span><br><span class="line">                     └───────────┘</span><br><span class="line">                           ▲</span><br><span class="line">                 ┌─────────┴─────────┐</span><br><span class="line">                 │                   │</span><br><span class="line">           ┌───────────┐       ┌───────────┐</span><br><span class="line">           │   Error   │       │ Exception │</span><br><span class="line">           └───────────┘       └───────────┘</span><br><span class="line">                 ▲                   ▲</span><br><span class="line">         ┌───────┘              ┌────┴──────────┐</span><br><span class="line">         │                      │               │</span><br><span class="line">┌─────────────────┐    ┌─────────────────┐┌───────────┐</span><br><span class="line">│OutOfMemoryError │... │RuntimeException ││IOException│...</span><br><span class="line">└─────────────────┘    └─────────────────┘└───────────┘</span><br><span class="line">                                ▲</span><br><span class="line">                    ┌───────────┴─────────────┐</span><br><span class="line">                    │                         │</span><br><span class="line">         ┌─────────────────────┐ ┌─────────────────────────┐</span><br><span class="line">         │NullPointerException │ │IllegalArgumentException │...</span><br><span class="line">         └─────────────────────┘ └─────────────────────────┘</span><br></pre></td></tr></table></figure>

<p>异常类型</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line">Exception</span><br><span class="line">│</span><br><span class="line">├─ RuntimeException</span><br><span class="line">│  │</span><br><span class="line">│  ├─ NullPointerException</span><br><span class="line">│  │</span><br><span class="line">│  ├─ IndexOutOfBoundsException</span><br><span class="line">│  │</span><br><span class="line">│  ├─ SecurityException</span><br><span class="line">│  │</span><br><span class="line">│  └─ IllegalArgumentException</span><br><span class="line">│     │</span><br><span class="line">│     └─ NumberFormatException</span><br><span class="line">│</span><br><span class="line">├─ IOException</span><br><span class="line">│  │</span><br><span class="line">│  ├─ UnsupportedCharsetException</span><br><span class="line">│  │</span><br><span class="line">│  ├─ FileNotFoundException</span><br><span class="line">│  │</span><br><span class="line">│  └─ SocketException</span><br><span class="line">│</span><br><span class="line">├─ ParseException</span><br><span class="line">│</span><br><span class="line">├─ GeneralSecurityException</span><br><span class="line">│</span><br><span class="line">├─ SQLException</span><br><span class="line">│</span><br><span class="line">└─ TimeoutException</span><br></pre></td></tr></table></figure>

<h2 id="日志-使用JDK-Logging"><a href="#日志-使用JDK-Logging" class="headerlink" title="日志,使用JDK Logging"></a>日志,使用JDK Logging</h2><p>JDK的Logging定义了7个日志级别，从严重到普通：</p>
<ul>
<li>SEVERE</li>
<li>WARNING</li>
<li>INFO</li>
<li>CONFIG</li>
<li>FINE</li>
<li>FINER</li>
<li>FINEST</li>
</ul>
<p>因为默认级别是INFO，因此，INFO级别以下的日志，不会被打印出来。使用日志级别的好处在于，调整级别，就可以屏蔽掉很多调试相关的日志输出。</p>
<h2 id="日志-使用Commons-Logging"><a href="#日志-使用Commons-Logging" class="headerlink" title="日志,使用Commons Logging"></a>日志,使用Commons Logging</h2><p>默认情况下，Commons Loggin自动搜索并使用Log4j（Log4j是另一个流行的日志系统），如果没有找到Log4j，再使用JDK Logging。</p>
<p>Commons Logging定义了6个日志级别：</p>
<ul>
<li>FATAL</li>
<li>ERROR</li>
<li>WARNING</li>
<li>INFO</li>
<li>DEBUG</li>
<li>TRACE</li>
</ul>
<p>默认级别是<code>INFO</code>。</p>
<h1 id="反射"><a href="#反射" class="headerlink" title="反射"></a>反射</h1><h2 id="class类"><a href="#class类" class="headerlink" title="class类"></a>class类</h2><p>方法一：直接通过一个<code>class</code>的静态变量<code>class</code>获取：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Class cls &#x3D; String.class;</span><br></pre></td></tr></table></figure>

<p>方法二：如果我们有一个实例变量，可以通过该实例变量提供的<code>getClass()</code>方法获取：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">String s &#x3D; &quot;Hello&quot;;</span><br><span class="line">Class cls &#x3D; s.getClass();</span><br></pre></td></tr></table></figure>

<p>方法三：如果知道一个<code>class</code>的完整类名，可以通过静态方法<code>Class.forName()</code>获取：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Class cls &#x3D; Class.forName(&quot;java.lang.String&quot;);</span><br></pre></td></tr></table></figure>

<p>注意一下<code>Class</code>实例比较和<code>instanceof</code>的差别：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">Integer n &#x3D; new Integer(123);</span><br><span class="line"></span><br><span class="line">boolean b1 &#x3D; n instanceof Integer; &#x2F;&#x2F; true，因为n是Integer类型</span><br><span class="line">boolean b2 &#x3D; n instanceof Number; &#x2F;&#x2F; true，因为n是Number类型的子类</span><br><span class="line"></span><br><span class="line">boolean b3 &#x3D; n.getClass() &#x3D;&#x3D; Integer.class; &#x2F;&#x2F; true，因为n.getClass()返回Integer.class</span><br><span class="line">boolean b4 &#x3D; n.getClass() &#x3D;&#x3D; Number.class; &#x2F;&#x2F; false，因为Integer.class!&#x3D;Number.class</span><br></pre></td></tr></table></figure>

<p>用<code>instanceof</code>不但匹配指定类型，还匹配指定类型的子类。而用<code>==</code>判断<code>class</code>实例可以精确地判断数据类型，但不能作子类型比较。</p>
<p>通常情况下，我们应该用<code>instanceof</code>判断数据类型，因为面向抽象编程的时候，我们不关心具体的子类型。只有在需要精确判断一个类型是不是某个<code>class</code>的时候，我们才使用<code>==</code>判断<code>class</code>实例。</p>
<p>如果获取到了一个<code>Class</code>实例，我们就可以通过该<code>Class</code>实例来创建对应类型的实例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;&#x2F; 获取String的Class实例:</span><br><span class="line">Class cls &#x3D; String.class;</span><br><span class="line">&#x2F;&#x2F; 创建一个String实例:</span><br><span class="line">String s &#x3D; (String) cls.newInstance();</span><br></pre></td></tr></table></figure>

<p>上述代码相当于<code>new String()</code>。通过<code>Class.newInstance()</code>可以创建类实例，它的局限是：只能调用<code>public</code>的无参数构造方法。带参数的构造方法，或者非<code>public</code>的构造方法都无法通过<code>Class.newInstance()</code>被调用。</p>
<h2 id="访问字段"><a href="#访问字段" class="headerlink" title="访问字段"></a>访问字段</h2><ul>
<li>Field getField(name)：根据字段名获取某个public的field（包括父类）</li>
<li>Field getDeclaredField(name)：根据字段名获取当前类的某个field（不包括父类）</li>
<li>Field[] getFields()：获取所有public的field（包括父类）</li>
<li>Field[] getDeclaredFields()：获取当前类的所有field（不包括父类） </li>
</ul>
<ol>
<li>getDeclaredFiled 仅能获取类本身的属性成员（包括私有、共有、保护）  </li>
<li>getField 仅能获取类(及其父类可以自己测试) public属性成员</li>
</ol>
<p>Java的反射API提供的<code>Field</code>类封装了字段的所有信息：</p>
<p>通过<code>Class</code>实例的方法可以获取<code>Field</code>实例：<code>getField()</code>，<code>getFields()</code>，<code>getDeclaredField()</code>，<code>getDeclaredFields()</code>；</p>
<p>通过Field实例可以获取字段信息：<code>getName()</code>，<code>getType()</code>，<code>getModifiers()</code>；</p>
<p>通过Field实例可以读取或设置某个对象的字段，如果存在访问限制，要首先调用<code>setAccessible(true)</code>来访问非<code>public</code>字段。</p>
<p>通过反射读写字段是一种非常规方法，它会破坏对象的封装。</p>
<h2 id="调用方法"><a href="#调用方法" class="headerlink" title="调用方法"></a>调用方法</h2><ul>
<li><code>Method getMethod(name, Class...)</code>：获取某个<code>public</code>的<code>Method</code>（包括父类）</li>
<li><code>Method getDeclaredMethod(name, Class...)</code>：获取当前类的某个<code>Method</code>（不包括父类）</li>
<li><code>Method[] getMethods()</code>：获取所有<code>public</code>的<code>Method</code>（包括父类）</li>
<li><code>Method[] getDeclaredMethods()</code>：获取当前类的所有<code>Method</code>（不包括父类）</li>
</ul>
<p>一个<code>Method</code>对象包含一个方法的所有信息：</p>
<ul>
<li><code>getName()</code>：返回方法名称，例如：<code>&quot;getScore&quot;</code>；</li>
<li><code>getReturnType()</code>：返回方法返回值类型，也是一个Class实例，例如：<code>String.class</code>；</li>
<li><code>getParameterTypes()</code>：返回方法的参数类型，是一个Class数组，例如：<code>&#123;String.class, int.class&#125;</code>；</li>
<li><code>getModifiers()</code>：返回方法的修饰符，它是一个<code>int</code>，不同的bit表示不同的含义。</li>
</ul>
<h3 id="小结"><a href="#小结" class="headerlink" title="小结"></a>小结</h3><p>Java的反射API提供的Method对象封装了方法的所有信息：</p>
<p>通过<code>Class</code>实例的方法可以获取<code>Method</code>实例：<code>getMethod()</code>，<code>getMethods()</code>，<code>getDeclaredMethod()</code>，<code>getDeclaredMethods()</code>；</p>
<p>通过<code>Method</code>实例可以获取方法信息：<code>getName()</code>，<code>getReturnType()</code>，<code>getParameterTypes()</code>，<code>getModifiers()</code>；</p>
<p>通过<code>Method</code>实例可以调用某个对象的方法：<code>Object invoke(Object instance, Object... parameters)</code>；</p>
<p>通过设置<code>setAccessible(true)</code>来访问非<code>public</code>方法；</p>
<p>通过反射调用方法时，仍然遵循多态原则。</p>
<h2 id="调用构造方法"><a href="#调用构造方法" class="headerlink" title="调用构造方法"></a>调用构造方法</h2><p>调用Class.newInstance()的局限是，它只能调用该类的public无参数构造方法。如果构造方法带有参数，或者不是public，就无法直接通过Class.newInstance()来调用。</p>
<ul>
<li><code>getConstructor(Class...)</code>：获取某个<code>public</code>的<code>Constructor</code>；</li>
<li><code>getDeclaredConstructor(Class...)</code>：获取某个<code>Constructor</code>；</li>
<li><code>getConstructors()</code>：获取所有<code>public</code>的<code>Constructor</code>；</li>
<li><code>getDeclaredConstructors()</code>：获取所有<code>Constructor</code>。</li>
</ul>
<p><code>Constructor</code>对象封装了构造方法的所有信息；</p>
<p>通过<code>Class</code>实例的方法可以获取<code>Constructor</code>实例：<code>getConstructor()</code>，<code>getConstructors()</code>，<code>getDeclaredConstructor()</code>，<code>getDeclaredConstructors()</code>；</p>
<p>通过<code>Constructor</code>实例可以创建一个实例对象：<code>newInstance(Object... parameters)</code>； 通过设置<code>setAccessible(true)</code>来访问非<code>public</code>构造方法。</p>
<h2 id="获取继承关系"><a href="#获取继承关系" class="headerlink" title="获取继承关系"></a>获取继承关系</h2><h3 id="小结-1"><a href="#小结-1" class="headerlink" title="小结"></a>小结</h3><p>通过<code>Class</code>对象可以获取继承关系：</p>
<ul>
<li><code>Class getSuperclass()</code>：获取父类类型；</li>
<li><code>Class[] getInterfaces()</code>：获取当前类实现的所有接口。</li>
</ul>
<p>通过<code>Class</code>对象的<code>isAssignableFrom()</code>方法可以判断一个向上转型是否可以实现。</p>
<h1 id="泛型"><a href="#泛型" class="headerlink" title="泛型"></a>泛型</h1><p>Java的泛型是采用擦拭法实现的；</p>
<p>擦拭法决定了泛型<code>&lt;T&gt;</code>：</p>
<ul>
<li>不能是基本类型，例如：<code>int</code>；</li>
<li>不能获取带泛型类型的<code>Class</code>，例如：<code>Pair&lt;String&gt;.class</code>；</li>
<li>不能判断带泛型类型的类型，例如：<code>x instanceof Pair&lt;String&gt;</code>；</li>
<li>不能实例化<code>T</code>类型，例如：<code>new T()</code>。</li>
</ul>
<p>泛型方法要防止重复定义方法，例如：<code>public boolean equals(T obj)</code>；</p>
<p>子类可以获取父类的泛型类型<code>&lt;T&gt;</code>。</p>
<h3 id="小结-2"><a href="#小结-2" class="headerlink" title="小结"></a>小结</h3><p>使用类似<code>&lt;? extends Number&gt;</code>通配符作为方法参数时表示：</p>
<ul>
<li>方法内部可以调用获取<code>Number</code>引用的方法，例如：<code>Number n = obj.getFirst();</code>；</li>
<li>方法内部无法调用传入<code>Number</code>引用的方法（<code>null</code>除外），例如：<code>obj.setFirst(Number n);</code>。</li>
</ul>
<p>即一句话总结：使用<code>extends</code>通配符表示可以读，不能写。</p>
<p>使用类似<code>&lt;T extends Number&gt;</code>定义泛型类时表示：</p>
<ul>
<li>泛型类型限定为<code>Number</code>以及<code>Number</code>的子类。</li>
</ul>
<h3 id="对比extends和super通配符"><a href="#对比extends和super通配符" class="headerlink" title="对比extends和super通配符"></a>对比extends和super通配符</h3><p>我们再回顾一下<code>extends</code>通配符。作为方法参数，<code>&lt;? extends T&gt;</code>类型和<code>&lt;? super T&gt;</code>类型的区别在于：</p>
<ul>
<li><code>&lt;? extends T&gt;</code>允许调用读方法<code>T get()</code>获取<code>T</code>的引用，但不允许调用写方法<code>set(T)</code>传入<code>T</code>的引用（传入<code>null</code>除外）；</li>
<li><code>&lt;? super T&gt;</code>允许调用写方法<code>set(T)</code>传入<code>T</code>的引用，但不允许调用读方法<code>T get()</code>获取<code>T</code>的引用（获取<code>Object</code>除外）。</li>
</ul>
<p>一个是允许读不允许写，另一个是允许写不允许读。</p>
<h3 id="无限定通配符"><a href="#无限定通配符" class="headerlink" title="无限定通配符"></a>无限定通配符</h3><p>因为<code>&lt;?&gt;</code>通配符既没有<code>extends</code>，也没有<code>super</code>，因此：</p>
<ul>
<li>不允许调用<code>set(T)</code>方法并传入引用（<code>null</code>除外）；</li>
<li>不允许调用<code>T get()</code>方法并获取<code>T</code>引用（只能获取<code>Object</code>引用）。</li>
</ul>
<p>换句话说，既不能读，也不能写，那只能做一些<code>null</code>判断：</p>
<h3 id="小结-3"><a href="#小结-3" class="headerlink" title="小结"></a>小结</h3><p>使用类似<code>&lt;? super Integer&gt;</code>通配符作为方法参数时表示：</p>
<ul>
<li>方法内部可以调用传入<code>Integer</code>引用的方法，例如：<code>obj.setFirst(Integer n);</code>；</li>
<li>方法内部无法调用获取<code>Integer</code>引用的方法（<code>Object</code>除外），例如：<code>Integer n = obj.getFirst();</code>。</li>
</ul>
<p>即使用<code>super</code>通配符表示只能写不能读。</p>
<p>使用<code>extends</code>和<code>super</code>通配符要遵循PECS原则。</p>
<p>无限定通配符<code>&lt;?&gt;</code>很少使用，可以用<code>&lt;T&gt;</code>替换，同时它是所有<code>&lt;T&gt;</code>类型的超类。</p>
<h1 id="集合"><a href="#集合" class="headerlink" title="集合"></a>集合</h1><h2 id="HashMap"><a href="#HashMap" class="headerlink" title="HashMap"></a>HashMap</h2><p>要正确使用<code>HashMap</code>，作为<code>key</code>的类必须正确覆写<code>equals()</code>和<code>hashCode()</code>方法；</p>
<p>一个类如果覆写了<code>equals()</code>，就必须覆写<code>hashCode()</code>，并且覆写规则是：</p>
<ul>
<li>如果<code>equals()</code>返回<code>true</code>，则<code>hashCode()</code>返回值必须相等；</li>
<li>如果<code>equals()</code>返回<code>false</code>，则<code>hashCode()</code>返回值尽量不要相等。</li>
</ul>
<p>实现<code>hashCode()</code>方法可以通过<code>Objects.hashCode()</code>辅助方法实现。</p>
<h2 id="TreeMap"><a href="#TreeMap" class="headerlink" title="TreeMap"></a>TreeMap</h2><p><code>SortedMap</code>在遍历时严格按照Key的顺序遍历，最常用的实现类是<code>TreeMap</code>；</p>
<p>作为<code>SortedMap</code>的Key必须实现<code>Comparable</code>接口，或者传入<code>Comparator</code>；</p>
<p>要严格按照<code>compare()</code>规范实现比较逻辑，否则，<code>TreeMap</code>将不能正常工作。</p>
<h2 id="Properties"><a href="#Properties" class="headerlink" title="Properties"></a>Properties</h2><p>Java集合库提供的<code>Properties</code>用于读写配置文件<code>.properties</code>。<code>.properties</code>文件可以使用UTF-8编码。</p>
<p>可以从文件系统、classpath或其他任何地方读取<code>.properties</code>文件。</p>
<p>读写<code>Properties</code>时，注意仅使用<code>getProperty()</code>和<code>setProperty()</code>方法，不要调用继承而来的<code>get()</code>和<code>put()</code>等方法。</p>
<h2 id="Set"><a href="#Set" class="headerlink" title="Set"></a>Set</h2><p><code>Set</code>用于存储不重复的元素集合，它主要提供以下几个方法：</p>
<ul>
<li>将元素添加进<code>Set&lt;E&gt;</code>：<code>boolean add(E e)</code></li>
<li>将元素从<code>Set&lt;E&gt;</code>删除：<code>boolean remove(Object e)</code></li>
<li>判断是否包含元素：<code>boolean contains(Object e)</code></li>
</ul>
<h2 id="Queue"><a href="#Queue" class="headerlink" title="Queue"></a>Queue</h2><p>在Java的标准库中，队列接口<code>Queue</code>定义了以下几个方法：</p>
<ul>
<li><code>int size()</code>：获取队列长度；</li>
<li><code>boolean add(E)</code>/<code>boolean offer(E)</code>：添加元素到队尾；</li>
<li><code>E remove()</code>/<code>E poll()</code>：获取队首元素并从队列中删除；</li>
<li><code>E element()</code>/<code>E peek()</code>：获取队首元素但并不从队列中删除。</li>
</ul>
<h2 id="PriorityQueue"><a href="#PriorityQueue" class="headerlink" title="PriorityQueue"></a>PriorityQueue</h2><p><code>PriorityQueue</code>实现了一个优先队列：从队首获取元素时，总是获取优先级最高的元素。</p>
<p><code>PriorityQueue</code>默认按元素比较的顺序排序（必须实现<code>Comparable</code>接口），也可以通过<code>Comparator</code>自定义排序算法（元素就不必实现<code>Comparable</code>接口）。</p>
<h2 id="Deque"><a href="#Deque" class="headerlink" title="Deque"></a>Deque</h2><table>
<thead>
<tr>
<th align="left">Queue</th>
<th align="left">Deque</th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td align="left">添加元素到队尾</td>
<td align="left">add(E e) / offer(E e)</td>
<td>addLast(E e) / offerLast(E e)</td>
</tr>
<tr>
<td align="left">取队首元素并删除</td>
<td align="left">E remove() / E poll()</td>
<td>E removeFirst() / E pollFirst()</td>
</tr>
<tr>
<td align="left">取队首元素但不删除</td>
<td align="left">E element() / E peek()</td>
<td>E getFirst() / E peekFirst()</td>
</tr>
<tr>
<td align="left">添加元素到队首</td>
<td align="left">无</td>
<td>addFirst(E e) / offerFirst(E e)</td>
</tr>
<tr>
<td align="left">取队尾元素并删除</td>
<td align="left">无</td>
<td>E removeLast() / E pollLast()</td>
</tr>
<tr>
<td align="left">取队尾元素但不删除</td>
<td align="left">无</td>
<td>E getLast() / E peekLast()</td>
</tr>
</tbody></table>
<p><code>Deque</code>实现了一个双端队列（Double Ended Queue），它可以：</p>
<ul>
<li>将元素添加到队尾或队首：<code>addLast()</code>/<code>offerLast()</code>/<code>addFirst()</code>/<code>offerFirst()</code>；</li>
<li>从队首／队尾获取元素并删除：<code>removeFirst()</code>/<code>pollFirst()</code>/<code>removeLast()</code>/<code>pollLast()</code>；</li>
<li>从队首／队尾获取元素但不删除：<code>getFirst()</code>/<code>peekFirst()</code>/<code>getLast()</code>/<code>peekLast()</code>；</li>
<li>总是调用<code>xxxFirst()</code>/<code>xxxLast()</code>以便与<code>Queue</code>的方法区分开；</li>
<li>避免把<code>null</code>添加到队列。</li>
</ul>
<h2 id="Stack"><a href="#Stack" class="headerlink" title="Stack"></a>Stack</h2><h1 id="IO流"><a href="#IO流" class="headerlink" title="IO流"></a>IO流</h1><p>IO流是一种流式的数据输入/输出模型：</p>
<ul>
<li>二进制数据以<code>byte</code>为最小单位在<code>InputStream</code>/<code>OutputStream</code>中单向流动；</li>
<li>字符数据以<code>char</code>为最小单位在<code>Reader</code>/<code>Writer</code>中单向流动。</li>
</ul>
<p>Java标准库的<code>java.io</code>包提供了同步IO功能：</p>
<ul>
<li>字节流接口：<code>InputStream</code>/<code>OutputStream</code>；</li>
<li>字符流接口：<code>Reader</code>/<code>Writer</code>。</li>
</ul>
<h2 id="File"><a href="#File" class="headerlink" title="File"></a>File</h2><p>Java标准库的<code>java.io.File</code>对象表示一个文件或者目录：</p>
<ul>
<li>创建<code>File</code>对象本身不涉及IO操作；</li>
<li>可以获取路径／绝对路径／规范路径：<code>getPath()</code>/<code>getAbsolutePath()</code>/<code>getCanonicalPath()</code>；</li>
<li>可以获取目录的文件和子目录：<code>list()</code>/<code>listFiles()</code>；</li>
<li>可以创建或删除文件和目录。</li>
</ul>
<h2 id="InputStream"><a href="#InputStream" class="headerlink" title="InputStream"></a>InputStream</h2><p>Java标准库的<code>java.io.InputStream</code>定义了所有输入流的超类：</p>
<ul>
<li><code>FileInputStream</code>实现了文件流输入；</li>
<li><code>ByteArrayInputStream</code>在内存中模拟一个字节流输入。</li>
</ul>
<p>总是使用<code>try(resource)</code>来保证<code>InputStream</code>正确关闭。</p>
<h2 id="OutputStream"><a href="#OutputStream" class="headerlink" title="OutputStream"></a>OutputStream</h2><p>Java标准库的<code>java.io.OutputStream</code>定义了所有输出流的超类：</p>
<ul>
<li><code>FileOutputStream</code>实现了文件流输出；</li>
<li><code>ByteArrayOutputStream</code>在内存中模拟一个字节流输出。</li>
</ul>
<p>某些情况下需要手动调用<code>OutputStream</code>的<code>flush()</code>方法来强制输出缓冲区。</p>
<p>总是使用<code>try(resource)</code>来保证<code>OutputStream</code>正确关闭。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">input.transferTo(output); &#x2F;&#x2F; copy功能;目录已存在</span><br></pre></td></tr></table></figure>

<h2 id="Reader"><a href="#Reader" class="headerlink" title="Reader"></a>Reader</h2><p><code>Reader</code>定义了所有字符输入流的超类：</p>
<ul>
<li><code>FileReader</code>实现了文件字符流输入，使用时需要指定编码；</li>
<li><code>CharArrayReader</code>和<code>StringReader</code>可以在内存中模拟一个字符流输入。</li>
</ul>
<p><code>Reader</code>是基于<code>InputStream</code>构造的：可以通过<code>InputStreamReader</code>在指定编码的同时将任何<code>InputStream</code>转换为<code>Reader</code>。</p>
<p>总是使用<code>try (resource)</code>保证<code>Reader</code>正确关闭。</p>
<p>使用InputStreamReader，可以把一个InputStream转换成一个Reader。</p>
<h2 id="Writer"><a href="#Writer" class="headerlink" title="Writer"></a>Writer</h2><p><code>Writer</code>定义了所有字符输出流的超类：</p>
<ul>
<li><code>FileWriter</code>实现了文件字符流输出；</li>
<li><code>CharArrayWriter</code>和<code>StringWriter</code>在内存中模拟一个字符流输出。</li>
</ul>
<p>使用<code>try (resource)</code>保证<code>Writer</code>正确关闭。</p>
<p><code>Writer</code>是基于<code>OutputStream</code>构造的，可以通过<code>OutputStreamWriter</code>将<code>OutputStream</code>转换为<code>Writer</code>，转换时需要指定编码。</p>
<h1 id="正则表达式"><a href="#正则表达式" class="headerlink" title="正则表达式"></a>正则表达式</h1><h3 id="小结-4"><a href="#小结-4" class="headerlink" title="小结"></a>小结</h3><p>单个字符的匹配规则如下：</p>
<table>
<thead>
<tr>
<th align="left">正则表达式</th>
<th align="left">规则</th>
<th align="left">可以匹配</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><code>A</code></td>
<td align="left">指定字符</td>
<td align="left"><code>A</code></td>
</tr>
<tr>
<td align="left"><code>\u548c</code></td>
<td align="left">指定Unicode字符</td>
<td align="left"><code>和</code></td>
</tr>
<tr>
<td align="left"><code>.</code></td>
<td align="left">任意字符</td>
<td align="left"><code>a</code>，<code>b</code>，<code>&amp;</code>，<code>0</code></td>
</tr>
<tr>
<td align="left"><code>\d</code></td>
<td align="left">数字0~9</td>
<td align="left"><code>0</code>~`9`</td>
</tr>
<tr>
<td align="left"><code>\w</code></td>
<td align="left">大小写字母，数字和下划线</td>
<td align="left"><code>a</code><del><code>z</code>，<code>A</code></del><code>Z</code>，<code>0</code>~`9<code>，</code>_`</td>
</tr>
<tr>
<td align="left"><code>\s</code></td>
<td align="left">空格、Tab键</td>
<td align="left">空格，Tab</td>
</tr>
<tr>
<td align="left"><code>\D</code></td>
<td align="left">非数字</td>
<td align="left"><code>a</code>，<code>A</code>，<code>&amp;</code>，<code>_</code>，……</td>
</tr>
<tr>
<td align="left"><code>\W</code></td>
<td align="left">非\w</td>
<td align="left"><code>&amp;</code>，<code>@</code>，<code>中</code>，……</td>
</tr>
<tr>
<td align="left"><code>\S</code></td>
<td align="left">非\s</td>
<td align="left"><code>a</code>，<code>A</code>，<code>&amp;</code>，<code>_</code>，……</td>
</tr>
</tbody></table>
<p>多个字符的匹配规则如下：</p>
<table>
<thead>
<tr>
<th align="left">正则表达式</th>
<th align="left">规则</th>
<th align="left">可以匹配</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><code>A*</code></td>
<td align="left">任意个数字符</td>
<td align="left">空，<code>A</code>，<code>AA</code>，<code>AAA</code>，……</td>
</tr>
<tr>
<td align="left"><code>A+</code></td>
<td align="left">至少1个字符</td>
<td align="left"><code>A</code>，<code>AA</code>，<code>AAA</code>，……</td>
</tr>
<tr>
<td align="left"><code>A?</code></td>
<td align="left">0个或1个字符</td>
<td align="left">空，<code>A</code></td>
</tr>
<tr>
<td align="left"><code>A&#123;3&#125;</code></td>
<td align="left">指定个数字符</td>
<td align="left"><code>AAA</code></td>
</tr>
<tr>
<td align="left"><code>A&#123;2,3&#125;</code></td>
<td align="left">指定范围个数字符</td>
<td align="left"><code>AA</code>，<code>AAA</code></td>
</tr>
<tr>
<td align="left"><code>A&#123;2,&#125;</code></td>
<td align="left">至少n个字符</td>
<td align="left"><code>AA</code>，<code>AAA</code>，<code>AAAA</code>，……</td>
</tr>
<tr>
<td align="left"><code>A&#123;0,3&#125;</code></td>
<td align="left">最多n个字符</td>
<td align="left">空，<code>A</code>，<code>AA</code>，<code>AAA</code></td>
</tr>
</tbody></table>
<h3 id="小结-5"><a href="#小结-5" class="headerlink" title="小结"></a>小结</h3><p>复杂匹配规则主要有：</p>
<table>
<thead>
<tr>
<th align="left">正则表达式</th>
<th align="left">规则</th>
<th align="left">可以匹配</th>
</tr>
</thead>
<tbody><tr>
<td align="left">^</td>
<td align="left">开头</td>
<td align="left">字符串开头</td>
</tr>
<tr>
<td align="left">$</td>
<td align="left">结尾</td>
<td align="left">字符串结束</td>
</tr>
<tr>
<td align="left">[ABC]</td>
<td align="left">[…]内任意字符</td>
<td align="left">A，B，C</td>
</tr>
<tr>
<td align="left">[A-F0-9xy]</td>
<td align="left">指定范围的字符</td>
<td align="left"><code>A</code>，……，<code>F</code>，<code>0</code>，……，<code>9</code>，<code>x</code>，<code>y</code></td>
</tr>
<tr>
<td align="left">[^A-F]</td>
<td align="left">指定范围外的任意字符</td>
<td align="left">非<code>A</code>~`F`</td>
</tr>
<tr>
<td align="left">AB|CD|EF</td>
<td align="left">AB或CD或EF</td>
<td align="left"><code>AB</code>，<code>CD</code>，<code>EF</code></td>
</tr>
</tbody></table>
<h1 id="多线程"><a href="#多线程" class="headerlink" title="多线程"></a>多线程</h1><p>Java用<code>Thread</code>对象表示一个线程，通过调用<code>start()</code>启动一个新线程；</p>
<p>一个线程对象只能调用一次<code>start()</code>方法；</p>
<p>线程的执行代码写在<code>run()</code>方法中；</p>
<p>线程调度由操作系统决定，程序本身无法决定调度顺序；</p>
<p><code>Thread.sleep()</code>可以把当前线程暂停一段时间。</p>
<h3 id="线程的优先级"><a href="#线程的优先级" class="headerlink" title="线程的优先级"></a>线程的优先级</h3><p>可以对线程设定优先级，设定优先级的方法是：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Thread.setPriority(int n) &#x2F;&#x2F; 1~10, 默认值5</span><br></pre></td></tr></table></figure>

<p>优先级高的线程被操作系统调度的优先级较高，操作系统对高优先级线程可能调度更频繁，但我们决不能通过设置优先级来确保高优先级的线程一定会先执行。</p>
<h2 id="中断线程"><a href="#中断线程" class="headerlink" title="中断线程"></a>中断线程</h2><p>对目标线程调用<code>interrupt()</code>方法可以请求中断一个线程，目标线程通过检测<code>isInterrupted()</code>标志获取自身是否已中断。如果目标线程处于等待状态，该线程会捕获到<code>InterruptedException</code>；</p>
<p>目标线程检测到<code>isInterrupted()</code>为<code>true</code>或者捕获了<code>InterruptedException</code>都应该立刻结束自身线程；</p>
<p>通过标志位判断需要正确使用<code>volatile</code>关键字；</p>
<p><code>volatile</code>关键字解决了共享变量在线程间的可见性问题。</p>
<h2 id="线程同步"><a href="#线程同步" class="headerlink" title="线程同步"></a>线程同步</h2><p>多线程同时读写共享变量时，会造成逻辑错误，因此需要通过<code>synchronized</code>同步；</p>
<p>同步的本质就是给指定对象加锁，加锁后才能继续执行后续代码；</p>
<p>注意加锁对象必须是同一个实例；</p>
<p>对JVM定义的单个原子操作不需要同步。</p>
<h2 id="同步方法"><a href="#同步方法" class="headerlink" title="同步方法"></a>同步方法</h2><p>用<code>synchronized</code>修饰方法可以把整个方法变为同步代码块，<code>synchronized</code>方法加锁对象是<code>this</code>；</p>
<p>通过合理的设计和数据封装可以让一个类变为“线程安全”；</p>
<p>一个类没有特殊说明，默认不是thread-safe；</p>
<p>多线程能否安全访问某个非线程安全的实例，需要具体问题具体分析。</p>
<h2 id="使用wait和notify"><a href="#使用wait和notify" class="headerlink" title="使用wait和notify"></a><a target="_blank" rel="noopener" href="https://www.liaoxuefeng.com/wiki/1252599548343744/1306580911915042">使用wait和notify</a></h2><p><code>wait</code>和<code>notify</code>用于多线程协调运行：</p>
<ul>
<li>在<code>synchronized</code>内部可以调用<code>wait()</code>使线程进入等待状态；</li>
<li>必须在已获得的锁对象上调用<code>wait()</code>方法；</li>
<li>在<code>synchronized</code>内部可以调用<code>notify()</code>或<code>notifyAll()</code>唤醒其他等待线程；</li>
<li>必须在已获得的锁对象上调用<code>notify()</code>或<code>notifyAll()</code>方法；</li>
<li>已唤醒的线程还需要重新获得锁后才能继续执行。</li>
</ul>
<h2 id="使用ReentrantLock"><a href="#使用ReentrantLock" class="headerlink" title="使用ReentrantLock"></a><a target="_blank" rel="noopener" href="https://www.liaoxuefeng.com/wiki/1252599548343744/1306580960149538">使用ReentrantLock</a></h2><p><code>ReentrantLock</code>可以替代<code>synchronized</code>进行同步；</p>
<p><code>ReentrantLock</code>获取锁更安全；</p>
<p>必须先获取到锁，再进入<code>try &#123;...&#125;</code>代码块，最后使用<code>finally</code>保证释放锁；</p>
<p>可以使用<code>tryLock()</code>尝试获取锁。</p>
<h2 id="使用Condition"><a href="#使用Condition" class="headerlink" title="使用Condition"></a>使用Condition</h2><p>可见，使用<code>Condition</code>时，引用的<code>Condition</code>对象必须从<code>Lock</code>实例的<code>newCondition()</code>返回，这样才能获得一个绑定了<code>Lock</code>实例的<code>Condition</code>实例。</p>
<p><code>Condition</code>提供的<code>await()</code>、<code>signal()</code>、<code>signalAll()</code>原理和<code>synchronized</code>锁对象的<code>wait()</code>、<code>notify()</code>、<code>notifyAll()</code>是一致的，并且其行为也是一样的：</p>
<ul>
<li><code>await()</code>会释放当前锁，进入等待状态；</li>
<li><code>signal()</code>会唤醒某个等待线程；</li>
<li><code>signalAll()</code>会唤醒所有等待线程；</li>
<li>唤醒线程从<code>await()</code>返回后需要重新获得锁。</li>
</ul>
<p>此外，和<code>tryLock()</code>类似，<code>await()</code>可以在等待指定时间后，如果还没有被其他线程通过<code>signal()</code>或<code>signalAll()</code>唤醒，可以自己醒来：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">if (condition.await(1, TimeUnit.SECOND)) &#123;</span><br><span class="line">    &#x2F;&#x2F; 被其他线程唤醒</span><br><span class="line">&#125; else &#123;</span><br><span class="line">    &#x2F;&#x2F; 指定时间内没有被其他线程唤醒</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>可见，使用<code>Condition</code>配合<code>Lock</code>，我们可以实现更灵活的线程同步。</p>
<h2 id="ReadWriteLock"><a href="#ReadWriteLock" class="headerlink" title="ReadWriteLock"></a>ReadWriteLock</h2><p>使用<code>ReadWriteLock</code>可以提高读取效率：</p>
<ul>
<li><code>ReadWriteLock</code>只允许一个线程写入；</li>
<li><code>ReadWriteLock</code>允许多个线程在没有写入时同时读取；</li>
<li><code>ReadWriteLock</code>适合读多写少的场景。</li>
</ul>
<h2 id="使用Concurrent集合"><a href="#使用Concurrent集合" class="headerlink" title="使用Concurrent集合"></a>使用Concurrent集合</h2><table>
<thead>
<tr>
<th align="left">interface</th>
<th align="left">non-thread-safe</th>
<th align="left">thread-safe</th>
</tr>
</thead>
<tbody><tr>
<td align="left">List</td>
<td align="left">ArrayList</td>
<td align="left">CopyOnWriteArrayList</td>
</tr>
<tr>
<td align="left">Map</td>
<td align="left">HashMap</td>
<td align="left">ConcurrentHashMap</td>
</tr>
<tr>
<td align="left">Set</td>
<td align="left">HashSet / TreeSet</td>
<td align="left">CopyOnWriteArraySet</td>
</tr>
<tr>
<td align="left">Queue</td>
<td align="left">ArrayDeque / LinkedList</td>
<td align="left">ArrayBlockingQueue / LinkedBlockingQueue</td>
</tr>
<tr>
<td align="left">Deque</td>
<td align="left">ArrayDeque / LinkedList</td>
<td align="left">LinkedBlockingDeque</td>
</tr>
</tbody></table>
<h2 id="ExecutorService"><a href="#ExecutorService" class="headerlink" title="ExecutorService"></a>ExecutorService</h2><p>JDK提供了<code>ExecutorService</code>实现了线程池功能：</p>
<ul>
<li><p>线程池内部维护一组线程，可以高效执行大量小任务；</p>
</li>
<li><p><code>Executors</code>提供了静态方法创建不同类型的<code>ExecutorService</code>；</p>
</li>
<li><p>必须调用<code>shutdown()</code>关闭<code>ExecutorService</code>；</p>
</li>
<li><p><code>ScheduledThreadPool</code>可以定期调度多个任务。</p>
</li>
<li><p>思考：</p>
<p>Q1:在FixedRate模式下，假设每秒触发，如果某次任务执行时间超过1秒，后续任务会不会并发执行？</p>
<p>A1:If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.</p>
<p>译：如果此任务的任何执行时间超过其周期，则<strong>后续执行可能会延迟开始，但不会并发执行。</strong></p>
<p>Q2:如果任务抛出了异常，后续任务是否继续执行？</p>
<p>A2：If any execution of the task encounters an exception, subsequent executions are suppressed. </p>
<p>译：如果任务的任何执行遇到异常，则将<strong>禁止后续任务的执行。</strong></p>
</li>
</ul>
<h2 id="使用Future"><a href="#使用Future" class="headerlink" title="使用Future"></a>使用Future</h2><p>当我们提交一个<code>Callable</code>任务后，我们会同时获得一个<code>Future</code>对象，然后，我们在主线程某个时刻调用<code>Future</code>对象的<code>get()</code>方法，就可以获得异步执行的结果。在调用<code>get()</code>时，如果异步任务已经完成，我们就直接获得结果。如果异步任务还没有完成，那么<code>get()</code>会阻塞，直到任务完成后才返回结果。</p>
<p>一个<code>Future&lt;V&gt;</code>接口表示一个未来可能会返回的结果，它定义的方法有：</p>
<ul>
<li><code>get()</code>：获取结果（可能会等待）</li>
<li><code>get(long timeout, TimeUnit unit)</code>：获取结果，但只等待指定的时间；</li>
<li><code>cancel(boolean mayInterruptIfRunning)</code>：取消当前任务；</li>
<li><code>isDone()</code>：判断任务是否已完成。</li>
</ul>
<h1 id="网络编程"><a href="#网络编程" class="headerlink" title="网络编程"></a>网络编程</h1><h2 id="TCP编程"><a href="#TCP编程" class="headerlink" title="TCP编程"></a>TCP编程</h2><p>使用Java进行TCP编程时，需要使用Socket模型：</p>
<ul>
<li>服务器端用<code>ServerSocket</code>监听指定端口；</li>
<li>客户端使用<code>Socket(InetAddress, port)</code>连接服务器；</li>
<li>服务器端用<code>accept()</code>接收连接并返回<code>Socket</code>；</li>
<li>双方通过<code>Socket</code>打开<code>InputStream</code>/<code>OutputStream</code>读写数据；</li>
<li>服务器端通常使用多线程同时处理多个客户端连接，利用线程池可大幅提升效率；</li>
<li><code>flush()</code>用于强制输出缓冲区到网络。</li>
</ul>
<h1 id="UDP"><a href="#UDP" class="headerlink" title="UDP"></a>UDP</h1><p>使用UDP协议通信时，服务器和客户端双方无需建立连接：</p>
<ul>
<li>服务器端用<code>DatagramSocket(port)</code>监听端口；</li>
<li>客户端使用<code>DatagramSocket.connect()</code>指定远程地址和端口；</li>
<li>双方通过<code>receive()</code>和<code>send()</code>读写数据；</li>
<li><code>DatagramSocket</code>没有IO流接口，数据被直接写入<code>byte[]</code>缓冲区。</li>
</ul>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">Xpand</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://www.qwas.top/p/java.html/">https://www.qwas.top/p/java.html/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://www.qwas.top" target="_blank">Xpand Bolg</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/java/">java</a></div><div class="post_share"><div class="social-share" data-image="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn/img/202204211026385.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-full"><a href="/p/gitxuexi.html/"><img class="prev-cover" data-lazy-src="https://cdn.jsdelivr.net/gh/xiaopengand/blogCdn@master/img/git%E5%91%BD%E4%BB%A4%E8%A1%A8-%E5%8E%8B%E7%BC%A9%E7%89%88.webp" onerror="onerror=null;src='https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@master/404/404.webp'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Git学习</div></div></a></div></nav><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside_content" id="aside_content"><div class="card-widget card-info"><div class="card-content"><div class="card-info-avatar is-center"><img class="avatar-img" data-lazy-src="https://q.qlogo.cn/headimg_dl?dst_uin=1822705653&amp;spec=640&amp;img_type=jpg" onerror="this.onerror=null;this.src='https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@master/404/404.gif'" alt="avatar"/><div class="author-info__name">Xpand</div><div class="author-info__description"></div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">11</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">17</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div></div><a class="button--animated" id="card-info-btn" href="https://www.qwas.top/"><i class="fa fa-bookmark"></i><span>点它 点它</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="tencent://message/?uin=1822705653" target="_blank" title="QQ"><i class="fab fa-qq"></i></a></div></div></div><div class="card-widget card-announcement"><div class="card-content"><div class="item-headline"><i class="fa fa-heartbeat card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">月亮很亮，亮也没用，没用也亮。 我在想你，想你没用，没用也想。</div></div><div class="xpand" style="height:200px;"><canvas class="illo" width="800" height="800" style="max-width: 200px; max-height: 200px; touch-action: none; width: 640px; height: 640px;"></canvas></div><script src="https://cdn.jsdelivr.net/gh/xiaopengand/blogCdn@latest/xzxr/twopeople1.js"></script><script src="https://cdn.jsdelivr.net/gh/xiaopengand/blogCdn@latest/xzxr/zdog.dist.js"></script><script id="rendered-js" src="https://cdn.jsdelivr.net/gh/xiaopengand/blogCdn@latest/xzxr/twopeople.js"></script><style>.card-widget.card-announcement {
margin: 0;
align-items: center;
justify-content: center;
text-align: center;
}
canvas {
display: block;
margin: 0 auto;
cursor: move;
}</style></div><div class="card-widget card-clock"><div class="card-glass"><div class="card-background"><div class="card-content"><div id="clock"><img v-if="clockshow == &quot;false&quot;" src="https://cdn.jsdelivr.net/gh/xiaopengand/blogCdn@latest/clock/images/weather/loading.gif" style="height:120px;width:100%"/><table class="clock" v-if="clockshow"><tbody><tr><td class="clockdate">{{date}}</td><td class="weatherimg" align="center" valign="middle"><img id="weatherimg" :src="weatherimg"/></td><td class="temperature" align="center" valign="middle">{{temperature}}</td><td class="humidityimg"><img id="humidityimg" :src="humidityimg"/></td><td class="humidity">{{humidity}}</td></tr><tr class="time"><td colspan="5">{{time}}</td></tr><tr><td class="usaqi" colspan="1"> <span>{{ip}}</span></td><td class="city" colspan="2">{{city}}</td><td class="daylight" colspan="2">{{daylight}}</td></tr></tbody></table></div></div></div></div></div><div class="card-widget card-history"><div class="card-content"><div class="item-headline"><i class="fas fa-clock fa-spin"></i><span>那年今日</span></div><div id="history-news" style="height: 100px;overflow: hidden;"><div id="history-card"></div></div></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="card-content"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#Java%E7%AC%94%E8%AE%B0"><span class="toc-number">1.</span> <span class="toc-text">Java笔记</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#Java%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8"><span class="toc-number">1.1.</span> <span class="toc-text">Java快速入门</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-1%E7%AC%AC%E4%B8%80%E4%B8%AAjava%E7%A8%8B%E5%BA%8F"><span class="toc-number">1.1.1.</span> <span class="toc-text">1.1第一个java程序</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BB%A7%E6%89%BF"><span class="toc-number">1.2.</span> <span class="toc-text">继承</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A4%9A%E6%80%81"><span class="toc-number">1.3.</span> <span class="toc-text">多态</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%8E%A5%E5%8F%A3"><span class="toc-number">1.4.</span> <span class="toc-text">接口</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#java%E6%A0%B8%E5%BF%83%E7%B1%BB"><span class="toc-number">2.</span> <span class="toc-text">java核心类</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%BC%82%E5%B8%B8%E5%A4%84%E7%90%86"><span class="toc-number">3.</span> <span class="toc-text">异常处理</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%97%A5%E5%BF%97-%E4%BD%BF%E7%94%A8JDK-Logging"><span class="toc-number">3.1.</span> <span class="toc-text">日志,使用JDK Logging</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%97%A5%E5%BF%97-%E4%BD%BF%E7%94%A8Commons-Logging"><span class="toc-number">3.2.</span> <span class="toc-text">日志,使用Commons Logging</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%8F%8D%E5%B0%84"><span class="toc-number">4.</span> <span class="toc-text">反射</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#class%E7%B1%BB"><span class="toc-number">4.1.</span> <span class="toc-text">class类</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%AE%BF%E9%97%AE%E5%AD%97%E6%AE%B5"><span class="toc-number">4.2.</span> <span class="toc-text">访问字段</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%B0%83%E7%94%A8%E6%96%B9%E6%B3%95"><span class="toc-number">4.3.</span> <span class="toc-text">调用方法</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%8F%E7%BB%93"><span class="toc-number">4.3.1.</span> <span class="toc-text">小结</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%B0%83%E7%94%A8%E6%9E%84%E9%80%A0%E6%96%B9%E6%B3%95"><span class="toc-number">4.4.</span> <span class="toc-text">调用构造方法</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%8E%B7%E5%8F%96%E7%BB%A7%E6%89%BF%E5%85%B3%E7%B3%BB"><span class="toc-number">4.5.</span> <span class="toc-text">获取继承关系</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%8F%E7%BB%93-1"><span class="toc-number">4.5.1.</span> <span class="toc-text">小结</span></a></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E6%B3%9B%E5%9E%8B"><span class="toc-number">5.</span> <span class="toc-text">泛型</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%8F%E7%BB%93-2"><span class="toc-number">5.0.1.</span> <span class="toc-text">小结</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AF%B9%E6%AF%94extends%E5%92%8Csuper%E9%80%9A%E9%85%8D%E7%AC%A6"><span class="toc-number">5.0.2.</span> <span class="toc-text">对比extends和super通配符</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%97%A0%E9%99%90%E5%AE%9A%E9%80%9A%E9%85%8D%E7%AC%A6"><span class="toc-number">5.0.3.</span> <span class="toc-text">无限定通配符</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%8F%E7%BB%93-3"><span class="toc-number">5.0.4.</span> <span class="toc-text">小结</span></a></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%9B%86%E5%90%88"><span class="toc-number">6.</span> <span class="toc-text">集合</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#HashMap"><span class="toc-number">6.1.</span> <span class="toc-text">HashMap</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#TreeMap"><span class="toc-number">6.2.</span> <span class="toc-text">TreeMap</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Properties"><span class="toc-number">6.3.</span> <span class="toc-text">Properties</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Set"><span class="toc-number">6.4.</span> <span class="toc-text">Set</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Queue"><span class="toc-number">6.5.</span> <span class="toc-text">Queue</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#PriorityQueue"><span class="toc-number">6.6.</span> <span class="toc-text">PriorityQueue</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Deque"><span class="toc-number">6.7.</span> <span class="toc-text">Deque</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Stack"><span class="toc-number">6.8.</span> <span class="toc-text">Stack</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#IO%E6%B5%81"><span class="toc-number">7.</span> <span class="toc-text">IO流</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#File"><span class="toc-number">7.1.</span> <span class="toc-text">File</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#InputStream"><span class="toc-number">7.2.</span> <span class="toc-text">InputStream</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#OutputStream"><span class="toc-number">7.3.</span> <span class="toc-text">OutputStream</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Reader"><span class="toc-number">7.4.</span> <span class="toc-text">Reader</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Writer"><span class="toc-number">7.5.</span> <span class="toc-text">Writer</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F"><span class="toc-number">8.</span> <span class="toc-text">正则表达式</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%8F%E7%BB%93-4"><span class="toc-number">8.0.1.</span> <span class="toc-text">小结</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%8F%E7%BB%93-5"><span class="toc-number">8.0.2.</span> <span class="toc-text">小结</span></a></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%A4%9A%E7%BA%BF%E7%A8%8B"><span class="toc-number">9.</span> <span class="toc-text">多线程</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%BA%BF%E7%A8%8B%E7%9A%84%E4%BC%98%E5%85%88%E7%BA%A7"><span class="toc-number">9.0.1.</span> <span class="toc-text">线程的优先级</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%AD%E6%96%AD%E7%BA%BF%E7%A8%8B"><span class="toc-number">9.1.</span> <span class="toc-text">中断线程</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BA%BF%E7%A8%8B%E5%90%8C%E6%AD%A5"><span class="toc-number">9.2.</span> <span class="toc-text">线程同步</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%90%8C%E6%AD%A5%E6%96%B9%E6%B3%95"><span class="toc-number">9.3.</span> <span class="toc-text">同步方法</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8wait%E5%92%8Cnotify"><span class="toc-number">9.4.</span> <span class="toc-text">使用wait和notify</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8ReentrantLock"><span class="toc-number">9.5.</span> <span class="toc-text">使用ReentrantLock</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8Condition"><span class="toc-number">9.6.</span> <span class="toc-text">使用Condition</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#ReadWriteLock"><span class="toc-number">9.7.</span> <span class="toc-text">ReadWriteLock</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8Concurrent%E9%9B%86%E5%90%88"><span class="toc-number">9.8.</span> <span class="toc-text">使用Concurrent集合</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#ExecutorService"><span class="toc-number">9.9.</span> <span class="toc-text">ExecutorService</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8Future"><span class="toc-number">9.10.</span> <span class="toc-text">使用Future</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B"><span class="toc-number">10.</span> <span class="toc-text">网络编程</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#TCP%E7%BC%96%E7%A8%8B"><span class="toc-number">10.1.</span> <span class="toc-text">TCP编程</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#UDP"><span class="toc-number">11.</span> <span class="toc-text">UDP</span></a></li></ol></div></div></div><div class="card-widget card-recent-post"><div class="card-content"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/p/cl3wfhlqi000j2kqxatbqhi5s.html/" title="hexo文章加密测试"><img data-lazy-src="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn/img/202204211037092.jpg" onerror="this.onerror=null;this.src='https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@master/404/404.webp'" alt="hexo文章加密测试"/></a><div class="content"><a class="title" href="/p/cl3wfhlqi000j2kqxatbqhi5s.html/" title="hexo文章加密测试">hexo文章加密测试</a><time datetime="2022-04-22T03:23:00.000Z" title="发表于 2022-04-22 11:23:00">2022-04-22</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/p/VMware1.html/" title="VMware 虚拟机开机自启"><img data-lazy-src="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn/img/20210112123855.png" onerror="this.onerror=null;this.src='https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@master/404/404.webp'" alt="VMware 虚拟机开机自启"/></a><div class="content"><a class="title" href="/p/VMware1.html/" title="VMware 虚拟机开机自启">VMware 虚拟机开机自启</a><time datetime="2022-04-20T03:11:11.000Z" title="发表于 2022-04-20 11:11:11">2022-04-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/p/cl3wfhlq800032kqx38oo9yw7.html/" title="Heroku上部署v2ray"><img data-lazy-src="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn/img/202204211026385.png" onerror="this.onerror=null;this.src='https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@master/404/404.webp'" alt="Heroku上部署v2ray"/></a><div class="content"><a class="title" href="/p/cl3wfhlq800032kqx38oo9yw7.html/" title="Heroku上部署v2ray">Heroku上部署v2ray</a><time datetime="2022-04-11T03:11:11.000Z" title="发表于 2022-04-11 11:11:11">2022-04-11</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/p/cl3wfhlqe000b2kqx4c4r7772.html/" title="mysql学习"><img data-lazy-src="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn/img/202204211026385.png" onerror="this.onerror=null;this.src='https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@master/404/404.webp'" alt="mysql学习"/></a><div class="content"><a class="title" href="/p/cl3wfhlqe000b2kqx4c4r7772.html/" title="mysql学习">mysql学习</a><time datetime="2021-05-06T06:29:23.000Z" title="发表于 2021-05-06 14:29:23">2021-05-06</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/p/wps_1.html/" title="WPS-Office中表格小问题"><img data-lazy-src="https://qn.cache.wpscdn.cn/encs/plus/imgs/img-index-p3@2x.8011b4b6.png" onerror="this.onerror=null;this.src='https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@master/404/404.webp'" alt="WPS-Office中表格小问题"/></a><div class="content"><a class="title" href="/p/wps_1.html/" title="WPS-Office中表格小问题">WPS-Office中表格小问题</a><time datetime="2021-03-25T02:17:39.000Z" title="发表于 2021-03-25 10:17:39">2021-03-25</time></div></div></div></div></div></div></div></main><footer id="footer" style="background-image: url(https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn/img/202204211026385.png)"><div id="footer-wrap"></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="font-plus" type="button" title="放大字体"><i class="fas fa-plus"></i></button><button id="font-minus" type="button" title="缩小字体"><i class="fas fa-minus"></i></button><button id="translateLink" type="button" title="简繁转换">簡</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.spacingElementById('content-inner')
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.spacingElementById('content-inner')
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script src="https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js"></script><script>var requestSetting = function (from,set) {
  var from = from
  var setting = set.split(',').filter(function(item){
  return from.indexOf(item) > -1
  });
  setting = setting.length == 0 ? from :setting;
  return setting
}

var guestInfo = requestSetting(['nick','mail','link'],'nick,mail,link')
var requiredFields = requestSetting(['nick','mail','link'],'nick,mail')
let friends = 'b54a2b47a00f4e0db177d6ff55bc5c2e,bc7e6b7c4c20c294c7b42846a18beaae,208501c4486b522ec8aefde5035cfbf5,7021c3626ea74a66f99a96eb37940cf2'.split(',')
let master = 'aa1a0ae323a0ca99dfb391f9e0ca8565,5f9df9c0455f94810d323eff7d43becf'.split(',')
let tagMeta = '博主,小伙伴,访客'.split(',')

function loadValine () {
  function initValine () {
    window.valine = new Valine({
      el: '#vcomment',
      appId: 'n2ky955cEwmG2fXTPR2brhV8-gzGzoHsz',
      appKey: 'j9yWSwEobTaIXHFl6TUDfDqU',
      placeholder: '📌月亮很亮，亮也没用，没用也亮。我在想你，想你没用，没用也想📌',
      avatar: 'monsterid',
      meta: 'nick,mail,link'.split(','),
      pageSize: '10',
      lang: 'zh-CN',
      recordIP: false,
      serverURLs: '',
      emojiCDN: '',
      emojiMaps: {"bilibili_罗小黑_自来水":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_自来水.png","bilibili_罗小黑_真棒":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_真棒.png","bilibili_罗小黑_找彩蛋":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_找彩蛋.png","bilibili_罗小黑_歪在吗":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_歪在吗.png","bilibili_罗小黑_撒花":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_撒花.png","bilibili_罗小黑_求包养":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_求包养.png","bilibili_罗小黑_你好呀":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_你好呀.png","bilibili_罗小黑_来了":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_来了.png","bilibili_罗小黑_可可爱爱":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_可可爱爱.png","bilibili_罗小黑_看电影":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_看电影.png","bilibili_罗小黑_加油":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_加油.png","bilibili_罗小黑_嗨":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_嗨.png","bilibili_罗小黑_鼓掌":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_鼓掌.png","bilibili_罗小黑_干杯":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_干杯.png","bilibili_罗小黑_大麦":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_大麦.png","bilibili_罗小黑_吃瓜":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bilibili/罗小黑_吃瓜.png","bili_tv_gif_抓狂":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/抓狂.gif","bili_tv_gif_再见":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/再见.gif","bili_tv_gif_晕":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/晕.gif","bili_tv_gif_疑问":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/疑问.gif","bili_tv_gif_斜眼笑":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/斜眼笑.gif","bili_tv_gif_笑哭":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/笑哭.gif","bili_tv_gif_无奈":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/无奈.gif","bili_tv_gif_委屈":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/委屈.gif","bili_tv_gif_微笑":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/微笑.gif","bili_tv_gif_吐血":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/吐血.gif","bili_tv_gif_偷笑":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/偷笑.gif","bili_tv_gif_思考":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/思考.gif","bili_tv_gif_睡着":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/睡着.gif","bili_tv_gif_生气":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/生气.gif","bili_tv_gif_生病":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/生病.gif","bili_tv_gif_色":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/色.gif","bili_tv_gif_亲亲":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/亲亲.gif","bili_tv_gif_呕吐":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/呕吐.gif","bili_tv_gif_难过":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/难过.gif","bili_tv_gif_腼腆":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/腼腆.gif","bili_tv_gif_流汗":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/流汗.gif","bili_tv_gif_流鼻血":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/流鼻血.gif","bili_tv_gif_困":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/困.gif","bili_tv_gif_抠鼻子":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/抠鼻子.gif","bili_tv_gif_可爱":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/可爱.gif","bili_tv_gif_惊吓":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/惊吓.gif","bili_tv_gif_坏笑":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/坏笑.gif","bili_tv_gif_黑人问号":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/黑人问号.gif","bili_tv_gif_害羞":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/害羞.gif","bili_tv_gif_鼓掌":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/鼓掌.gif","bili_tv_gif_尴尬":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/尴尬.gif","bili_tv_gif_发怒":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/发怒.gif","bili_tv_gif_发财":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/发财.gif","bili_tv_gif_调皮":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/调皮.gif","bili_tv_gif_点赞":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/点赞.gif","bili_tv_gif_呆":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/呆.gif","bili_tv_gif_大佬":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/大佬.gif","bili_tv_gif_大哭":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/大哭.gif","bili_tv_gif_打脸":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/打脸.gif","bili_tv_gif_馋":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/馋.gif","bili_tv_gif_闭嘴":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/闭嘴.gif","bili_tv_gif_鄙视":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/鄙视.gif","bili_tv_gif_白眼":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/白眼.gif","bili_tv_gif_doge":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/bili_tv_gif/doge.gif","恶搞QQ_180":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/180.gif","恶搞QQ_179":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/179.gif","恶搞QQ_178":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/178.gif","恶搞QQ_177":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/177.gif","恶搞QQ_176":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/176.gif","恶搞QQ_175":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/175.gif","恶搞QQ_174":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/174.gif","恶搞QQ_173":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/173.gif","恶搞QQ_172":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/172.gif","恶搞QQ_171":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/171.gif","恶搞QQ_170":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/170.gif","恶搞QQ_169":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/169.gif","恶搞QQ_168":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/168.gif","恶搞QQ_167":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/167.gif","恶搞QQ_166":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/166.gif","恶搞QQ_165":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/165.gif","恶搞QQ_164":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/164.gif","恶搞QQ_163":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/163.gif","恶搞QQ_162":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/162.gif","恶搞QQ_161":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/161.gif","恶搞QQ_160":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/160.gif","恶搞QQ_159":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/159.gif","恶搞QQ_158":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/158.jpg","恶搞QQ_157":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/157.gif","恶搞QQ_156":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/156.gif","恶搞QQ_155":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/155.gif","恶搞QQ_154":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/154.gif","恶搞QQ_153":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/153.gif","恶搞QQ_152":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/152.png","恶搞QQ_151":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/151.gif","恶搞QQ_150":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/150.gif","恶搞QQ_149":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/149.gif","恶搞QQ_148":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/148.gif","恶搞QQ_147":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/147.gif","恶搞QQ_146":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/146.gif","恶搞QQ_145":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/145.gif","恶搞QQ_144":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/144.gif","恶搞QQ_143":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/143.gif","恶搞QQ_142":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/142.gif","恶搞QQ_141":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/141.gif","恶搞QQ_140":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/140.gif","恶搞QQ_139":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/139.gif","恶搞QQ_138":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/138.gif","恶搞QQ_137":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/137.gif","恶搞QQ_136":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/136.gif","恶搞QQ_135":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/135.gif","恶搞QQ_134":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/134.gif","恶搞QQ_133":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/133.jpg","恶搞QQ_132":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/132.gif","恶搞QQ_131":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/131.gif","恶搞QQ_130":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/130.gif","恶搞QQ_129":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/129.gif","恶搞QQ_128":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/128.gif","恶搞QQ_127":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/127.gif","恶搞QQ_126":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/126.gif","恶搞QQ_125":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/125.gif","恶搞QQ_124":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/124.gif","恶搞QQ_123":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/123.gif","恶搞QQ_122":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/122.gif","恶搞QQ_121":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/121.gif","恶搞QQ_120":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/120.gif","恶搞QQ_119":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/119.gif","恶搞QQ_118":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/118.gif","恶搞QQ_117":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/117.gif","恶搞QQ_116":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/116.gif","恶搞QQ_115":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/115.gif","恶搞QQ_114":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/114.gif","恶搞QQ_113":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/113.gif","恶搞QQ_112":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/112.gif","恶搞QQ_111":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/111.gif","恶搞QQ_110":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/110.gif","恶搞QQ_109":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/109.jpg","恶搞QQ_108":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/108.gif","恶搞QQ_107":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/107.gif","恶搞QQ_106":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/106.gif","恶搞QQ_105":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/105.gif","恶搞QQ_104":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/104.gif","恶搞QQ_103":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/103.gif","恶搞QQ_102":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/102.gif","恶搞QQ_101":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/101.gif","恶搞QQ_100":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/100.gif","恶搞QQ_99":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/99.gif","恶搞QQ_98":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/98.gif","恶搞QQ_97":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/97.gif","恶搞QQ_96":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/96.jpg","恶搞QQ_95":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/95.gif","恶搞QQ_94":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/94.gif","恶搞QQ_93":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/93.gif","恶搞QQ_92":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/92.gif","恶搞QQ_91":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/91.gif","恶搞QQ_90":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/90.gif","恶搞QQ_89":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/89.gif","恶搞QQ_88":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/88.gif","恶搞QQ_87":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/87.gif","恶搞QQ_86":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/86.gif","恶搞QQ_85":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/85.gif","恶搞QQ_84":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/84.gif","恶搞QQ_83":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/83.gif","恶搞QQ_82":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/82.gif","恶搞QQ_81":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/81.jpg","恶搞QQ_80":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/80.gif","恶搞QQ_79":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/79.gif","恶搞QQ_78":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/78.gif","恶搞QQ_77":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/77.gif","恶搞QQ_76":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/76.gif","恶搞QQ_75":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/75.jpg","恶搞QQ_74":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/74.gif","恶搞QQ_73":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/73.gif","恶搞QQ_72":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/72.gif","恶搞QQ_71":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/71.gif","恶搞QQ_70":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/70.gif","恶搞QQ_69":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/69.gif","恶搞QQ_68":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/68.gif","恶搞QQ_67":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/67.gif","恶搞QQ_66":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/66.gif","恶搞QQ_65":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/65.jpg","恶搞QQ_64":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/64.gif","恶搞QQ_63":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/63.gif","恶搞QQ_62":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/62.gif","恶搞QQ_61":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/61.gif","恶搞QQ_60":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/60.gif","恶搞QQ_59":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/59.gif","恶搞QQ_58":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/58.gif","恶搞QQ_57":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/57.gif","恶搞QQ_56":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/56.gif","恶搞QQ_55":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/55.jpg","恶搞QQ_54":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/54.gif","恶搞QQ_53":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/53.gif","恶搞QQ_52":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/52.gif","恶搞QQ_51":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/51.jpg","恶搞QQ_50":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/50.gif","恶搞QQ_49":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/49.gif","恶搞QQ_48":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/48.gif","恶搞QQ_47":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/47.gif","恶搞QQ_46":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/46.gif","恶搞QQ_45":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/45.gif","恶搞QQ_44":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/44.gif","恶搞QQ_43":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/43.gif","恶搞QQ_42":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/42.gif","恶搞QQ_41":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/41.gif","恶搞QQ_40":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/40.gif","恶搞QQ_39":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/39.gif","恶搞QQ_38":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/38.gif","恶搞QQ_37":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/37.gif","恶搞QQ_36":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/36.gif","恶搞QQ_35":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/35.gif","恶搞QQ_34":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/34.gif","恶搞QQ_33":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/33.gif","恶搞QQ_32":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/32.gif","恶搞QQ_31":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/31.gif","恶搞QQ_30":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/30.gif","恶搞QQ_29":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/29.gif","恶搞QQ_28":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/28.gif","恶搞QQ_27":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/27.gif","恶搞QQ_26":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/26.gif","恶搞QQ_25":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/25.gif","恶搞QQ_24":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/24.gif","恶搞QQ_23":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/23.gif","恶搞QQ_22":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/22.gif","恶搞QQ_21":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/21.gif","恶搞QQ_20":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/20.gif","恶搞QQ_19":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/19.gif","恶搞QQ_18":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/18.gif","恶搞QQ_17":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/17.gif","恶搞QQ_16":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/16.gif","恶搞QQ_15":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/15.gif","恶搞QQ_14":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/14.gif","恶搞QQ_13":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/13.gif","恶搞QQ_12":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/12.png","恶搞QQ_11":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/11.gif","恶搞QQ_10":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/10.png","恶搞QQ_9":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/9.gif","恶搞QQ_8":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/8.gif","恶搞QQ_7":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/7.gif","恶搞QQ_6":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/6.gif","恶搞QQ_5":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/5.gif","恶搞QQ_4":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/4.gif","恶搞QQ_3":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/3.gif","恶搞QQ_2":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/2.gif","恶搞QQ_1":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/恶搞QQ/1.gif","custom_32":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/31.webp","custom_31":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/30.gif","custom_30":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/29.webp","custom_29":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/28.webp","custom_28":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/27.webp","custom_27":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/26.webp","custom_26":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/25.jpg","custom_25":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/24.webp","custom_24":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/23.webp","custom_23":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/22.webp","custom_22":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/21.webp","custom_21":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/20.webp","custom_20":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/19.webp","custom_19":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/18.jpg","custom_18":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/17.webp","custom_17":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/16.webp","custom_16":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/15.webp","custom_15":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/14.webp","custom_14":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/13.webp","custom_13":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/12.webp","custom_12":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/11.webp","custom_11":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/10.webp","custom_10":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/9.webp","custom_9":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/8.webp","custom_8":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/7.webp","custom_7":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/6.gif","custom_6":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/5.gif","custom_5":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/4.jpg","custom_4":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/3.jpg","custom_3":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/2.webp","custom_2":"https://cdn.jsdelivr.net/gh/xiaopengand/emotion/custom/1.webp"},
      enableQQ: true,
      path: window.location.pathname,
      master: master,
      friends: friends,
      tagMeta: tagMeta,
      metaPlaceholder: {"nick":"昵称/QQ号(必填)","mail":"邮箱(必填)","link":"网址(https://)","tagMeta":"博主,小伙伴,访客"}
    });
    if ('nick,mail') { valine.config.requiredFields= 'nick,mail'.split(',') }
  }

  if (typeof Valine === 'function') initValine() 
  else $.getScript('https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js', initValine)
}

if ('Valine' === 'Valine' || !false) {
  if (false) loadComment(document.querySelector('#vcomment'),loadValine)
  else setTimeout(() => loadValine(), 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script src="https://unpkg.com/jquery@latest/dist/jquery.min.js"></script><script src="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@latest/clock/js/vue.min.js"></script><script data-pjax src="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@latest/clock/js/clock.js"></script><script data-pjax src="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@latest/history/history.js"></script><script data-pjax src="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@latest/history/historyroll.js"></script><script data-pjax src="https://fastly.jsdelivr.net/gh/xiaopengand/blogCdn@latest/fishes.js"></script><script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js?id=JgCZI0XQvuipVSsY&ck=JgCZI0XQvuipVSsY"></script><script id="click-show-text" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-show-text.min.js" data-mobile="true" data-text="富强,民主,文明,和谐,爱国,敬业,诚信,友善,自由,平等,公正,法治" data-fontsize="15px" data-random="true" async="async"></script><script>(function(){
  const bp = document.createElement('script');
  const curProtocol = window.location.protocol.split(':')[0];
  if (curProtocol === 'https') {
    bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
  }
  else{
    bp.src = 'http://push.zhanzhang.baidu.com/push.js';
  }
  bp.dataset.pjax = ''
  const s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(bp, s);
})()</script></div><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"log":false,"model":{"scale":1.1,"jsonPath":"https://cdn.jsdelivr.net/gh/xiaopengand/blogCdn@master/xiaomai/xiaomai.model.json"},"display":{"superSample":2,"position":"right","width":150,"height":300,"hOffset":180,"vOffset":-1},"mobile":{"show":false},"react":{"opacity":0.9},"dialog":{"enable":true,"hitokoto":true},"encrypt":{"enable":true}});</script></body></html>